﻿namespace Northwind.ViewModel
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using GalaSoft.MvvmLight;
    using Northwind.Interfaces.Data.Model;
    using System.ComponentModel;

    public class EmployeeViewModel : ViewModelBase, IEmployeeModel
    {
        #region Constructors

        IEmployeeModel _model;

        public EmployeeViewModel(IEmployeeModel model)
        {
            _model = model;
            ((INotifyPropertyChanged)_model).PropertyChanged += new PropertyChangedEventHandler(_model_PropertyChanged);
        }

        void _model_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            //throw new NotImplementedException();
        }
        #endregion

        public System.Collections.ObjectModel.ObservableCollection<IOrderModel> Orders
        {
            get { throw new NotImplementedException(); }
        }

        public int EmployeeID
        {
            get
            {
                return _model.EmployeeID;
            }
            set
            {
                _model.EmployeeID = value;
                RaisePropertyChanged("EmployeeID");
            }
        }

        public string LastName
        {
            get
            {
                return _model.LastName;
            }
            set
            {
                _model.LastName = value;
                RaisePropertyChanged("LastName");
            }
        }

        public string FirstName
        {
            get
            {
                return _model.FirstName;
            }
            set
            {
                _model.FirstName = value;
                RaisePropertyChanged("FirstName");
            }
        }

        public string Title
        {
            get
            {
                return _model.Title;
            }
            set
            {
                _model.Title = value;
                RaisePropertyChanged("Title");
            }
        }
    }
}
